/*
 *  contact.h - Contact management functions
 *  Copyright (c) 2005 Derek Ingrouville (dergro@users.sourceforge.net)
 *
 *  This program is free software; you can redistribute it and/or modify
 *  it under the terms of the GNU General Public License as published by
 *  the Free Software Foundation; either version 2 of the License, or
 *  (at your option) any later version.
 *
 *  This program is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *  GNU Library General Public License for more details.
 *
 *  You should have received a copy of the GNU General Public License
 *  along with this program; if not, write to the Free Software
 *  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
 */

#ifndef _CONTACT_H
#define _CONTACT_H

#include <glib.h>

#include "command.h"
#include "msnobj.h"

typedef enum _MsnStatus
{
    ONLINE = 0,
    AWAY,
    IDLE,
    BRB,
    BUSY,
    LUNCH,
    PHONE,
    HIDDEN,
    OFFLINE
} MsnStatus;

/* TODO: make sure this goes here and add client caps to contact struct */
typedef enum _MsnClientCaps
{
	CLIENT_WIN_MOBILE = 1,
	CLIENT_RECEIVE_INK = 4,
	CLIENT_SEND_RECEIVE_INK = 8,
	CLIENT_VIDEO_CONVO = 16,
	CLIENT_MULTI_PACKET_MSGS = 32,
	CLIENT_MSN_MOBILE = 64,
	CLIENT_MSN_DIRECT = 128,
	CLIENT_WEB_MSN = 512,
	CLIENT_MSNC1 = 268435456,
	CLIENT_MSNC2 = 536870912,
	CLIENT_MSNC3 = 805306368,
	CLIENT_MSNC5 = 1073741824
} MsnClientCaps;

typedef struct _MsnContact
{
    char *passport;
    char *nickname;
    char *home_phone;
    char *work_phone;
    char *mobile_phone;
    char *guid;
	MsnObject *obj;
    int lists;          /* Lists that the contact is on */
	int type;
    GList *groups;      /* IDs of groups contact is in */
    MsnStatus status;
} MsnContact;

MsnContact *msn_contact_new ();
MsnContact *msn_contact_from_lst (MsnCommand *lst);
void msn_contact_free (MsnContact *contact);

/* boolean: check if contact is a member of the forward list */
inline int msn_contact_on_forwardlist (MsnContact *contact);

void msn_contact_set_passport (MsnContact *contact, const char *passport);
void msn_contact_set_nickname (MsnContact *contact, const char *nickname);
/* set groups from a comman seperated list of group ids */
int msn_contact_set_groups (MsnContact *contact, const char *groups);
void msn_contact_set_home_phone (MsnContact *contact, const char *home_num);
void msn_contact_set_work_phone (MsnContact *contact, const char *work_num);
void msn_contact_set_mobile_phone (MsnContact *contact, const char *mobile_num);
void msn_contact_set_msn_object (MsnContact *contact, MsnObject *obj);

#endif /* _CONTACT_H */

